package com.cloudcc.mobile.util;

import com.cloudcc.mobile.entity.beau.IsFollowmem;

import java.util.Comparator;

/**
 * Created by xhsdele on 2017/7/31 0031.
 */

public class NameComParator implements Comparator<IsFollowmem.followitem> {
    @Override
    public int compare(IsFollowmem.followitem lhs, IsFollowmem.followitem rhs) {

//        try {
//                PinyinUtils.converterToFirstSpell((rhs.name));
//            } catch (Exception e) {
//                e.printStackTrace();
//                rhs.name = "宗";
//        }
//        try {
//            PinyinUtils.converterToFirstSpell((lhs.name));
//        } catch (Exception e) {
//            e.printStackTrace();
//            rhs.name = "宗";
//        }
        String str1 = PinyinUtils.converterToFirstSpell((rhs.name));
        String str2 = PinyinUtils.converterToFirstSpell((lhs.name));
        return str2.compareTo(str1);
    }
}
